//
//  BaseButtonVIew.m
//  OpenYourEyes
//
//  Created by zhanglei on 15/8/10.
//  Copyright (c) 2015年 zhanglei. All rights reserved.
//

#import "BaseButtonVIew.h"

@implementation BaseButtonVIew


- (instancetype)initWithFrame:(CGRect)frame name:(NSString *)name Image:(UIImage *)image
{
    if (self = [super initWithFrame:frame]) {
        
        _iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width / 3, frame.size.height)];
        _iconImageView.image = image;
        
        _iconLabel = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width / 3, 0, 2*frame.size.width / 3, frame.size.height)];
        _iconLabel.text = name;
        _iconLabel.textColor = [UIColor colorWithWhite:0.900 alpha:1];
        
        [self addSubview:_iconLabel];
        [self addSubview:_iconImageView];
    }
    return self;
}

+ (instancetype)initWithFrame:(CGRect)frame name:(NSString *)name Image:(UIImage *)image;
{
    return [self initWithFrame:frame name:name Image:image];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
